ti<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td bgcolor="#cccccc" width="200" valign="top"><!-- variable RHS Menu -->
	<?php 
	if($_SESSION['user_groups_id']=="2")
	{
		require('templates/menu2.php');
	}
	elseif($_SESSION['user_groups_id']=="6")
	{
		require('templates/menu6.php');
	}	
	else
	{
		require('templates/menu7.php');
	}
	
?>
	
      </td>
    <td valign="top" style="padding:30px 30px 30px 30px;">
	<table border="0" width="750" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px">
        <tr>
		<td>
		<b><div id="resultshere1" class="errorText">
		<?php
	 if($_REQUEST['aexit']==1)
	{
	echo 'User already exist';
	}
	 ?>
	 	<?php
	 if($_REQUEST['nexit']==1)
	{
	echo 'User not found in records';
	}
	 ?>
	 	<?php
	 if($_REQUEST['v']=='success')
	{
	echo 'Your Request has been submitted';
	}
	 ?>
		</div></b>
		</td>
		</tr>
		<tr>
          <td colspan="3" align="left"><img src="heading/Request-Laptop_03.jpg"></td>
        </tr>
        <tr>
		<td>
		<form name="requestType" action="request_type.php" method="post">
		<table border="0">
		<tr>
          <td><b>Request Type:</b>
            <select size="1" name="request_type" id="request_type">
              <option value="0" selected="selected">Select</option>
              <option value="1" <?php echo $indsel;?>>Indiviual</option>
              <option value="2" <?php echo $grpsel;?>>Group</option>
            </select>
          </td>
          <td><b>Employee Type:</b>
            <select size="1" name="employee_type" id="employee_type">
              <option value="0" selected="selected">Select</option>
              <option value="1" <?php echo $newsel;?>>New</option>
              <option value="2" <?php echo $oldsel;?>>Old</option>
            </select>
          </td>
          <td><input type="submit" value="Go" class="submit-butt" name="search" id="search" onClick="return recordSearch(this.form);"/></td>
		  </tr>
		  </table>
		  </form>
		  </td>
        </tr>
        <tr>
          <td colspan="3" height="20"></td>
        </tr>
        <tr>
          <td colspan="3">
		 <form name="frmRequestLaptop" id="frmRequestLaptop" method="post" action="requestlaptop_process.php">
		  <table class="grid" border="0" width="740">
		      <?php if($_REQUEST['action']=='ind_new'){ ?>
			  <tr>
                <td width="144px"><b>Depot Location</b></td>
                <!--php code here -->
                <td>:</td>
                <td><?php echo GetDepotLocation();?>
                </td>
              </tr>
			  <tr>
                <td><b>Employee No</b></td>
                <td>:</td>
                <td><input type="text" name="empno" id="empno" size="20"></td>
              </tr>
              <tr>
                <td><b>Employee Firstname</b></td>
                <td>:</td>
                <td><input name="emp_fname" id="emp_fname" type="text" size="20"></td>
              </tr>
              <tr>
                <td><b>Employee Lastname</b></td>
                <!--php code here -->
                <td>:</td>
                <td><input name="emp_lname" id="emp_lname" type="text" size="20">
                </td>
              </tr>
			 
			  <tr>
                <td><b>Employee Designation</b></td>
                <!--php code here -->
                <td>:</td>
                <td><?php echo GetEmpDesignationName();?>
                </td>
              </tr>

			   <tr>
                <td><b>Date Of Joinning</b></td>
                <!--php code here -->
                <td>:</td>
                <td><input  type="text" id="docdate" name="docdate" value="" readonly="readonly" size="15"/>
                  &nbsp;<img src="images/icon_calendar.png" id="icon_calendardate" width="20" height="17" alt="Calendar" border="0" align="absmiddle" onMouseOver="CalCalender('docdate','icon_calendardate')" /> &nbsp;<small>(dd-mm-yyyy)</small>&nbsp;&nbsp;<span style="color:#FF0000"></span>
                </td>
              </tr>
			  
			  
		     <tr>
                <td><b>Employee Address</b></td>
                <td>:</td>
                <td><input type="text" name="emp_address" id="emp_address" size="20"></td>
              </tr>
              <tr>
                <td><b>Employee Telephone</b></td>
                <td>:</td>
                <td><input type="text" name="emp_telno" id="emp_telno" size="20" onKeyPress="return phoneValue(event)"></td>
              </tr>
			  <tr>
                <td><b>Employee Email Address</b></td>
                <td>:</td>
                <td><input name="emp_email" id="emp_email" type="text" size="20"></td>
              </tr>
			  <tr>
                <td><b>Reporting to Depot</b></td>
                <!--php code here -->
                <td>:</td>
                <td><?php echo GetEmpDepot();?>
                </td>
              </tr>              
			   <tr>
                <td><b>Division</b></td>
                <td>:</td>
                <td><?php echo GetDivisionName();?></td>
              </tr>
              <tr>
                <td><b>Region</b></td>
                <td>:</td>
                <td><input type="text" name="region" id="region" size="20"></td>
              </tr>
              <tr>
                <td><b>Laptop Model</b></td>
                <td>:</td>
                <td>
				<select name="laptop_model1" id="MtLap" style="display:none;" ></select>
				<div id="NonMtLap"><?php echo GetLaptopModelName();?></div>
				</td>
              </tr>			  
              <tr>
                <td><b>Dispatch To Depot</b></td>
                <td>:</td>
                <td><?php echo GetDispatchLocation();?></td>
              </tr>
			  <tr>
                <td><b>Dispatch Location Address</b></td>
                <td>:</td>
                <td><input type="text" name="dispatch_location_address" id="dispatch_location_address" size="20"></td>
              </tr>
              <tr>
                <td><b>Dispatch Date</b></td>
                <td>:</td>
                <td><input  type="text" id="doc3" name="doc3" value="" readonly="readonly" size="15"/>
                  &nbsp;<img src="images/icon_calendar.png" id="icon_calendar1" width="20" height="17" alt="Calendar" border="0" align="absmiddle" onMouseOver="CalCalender('doc3','icon_calendar1')" /> &nbsp;<small>(dd-mm-yyyy)</small>&nbsp;&nbsp;<span style="color:#FF0000">(Mention the date at which laptops are to be delivered)</span></td>
              </tr>
			  
			  
			  
       			  <input type="hidden" value="1" id="indnew" name="indnew" />
			  <?php }
			   elseif($_REQUEST['action']=='ind_old'){
			   $sql=mysql_query('SELECT  usr.user_no,usr.user_firstname,usr.user_lastname,lpt.division,lpt.laptopmodel,lpt.region,usr.depot,lpt.dispatch_location,lpt.laptop_id,lpt.dispatch_location_add FROM users as usr INNER JOIN  laptop as lpt ON  usr.user_id = lpt.user_id where usr.user_no="'.$_REQUEST['emp_no'].'"');
			   $row=mysql_fetch_array($sql);
			  ?>
                 
			   <tr>
                <td><b>Employee No</b></td>
                <td>:</td>
                <td><input name="emp_oldno" id="emp_oldno" value="<?php echo $_REQUEST['emp_no'];?>" type="text" size="20" onchange="getData(this.value);"></td>
              </tr>
			  
			   <tr>
                <td><b>Depot Location</b></td>
                <!--php code here -->
                <td>:</td>
                <td><?php echo GetDepotLocation1();?>
                </td>
               </tr> 
			   
			    <tr>
                <td><b>Laptop Type</b></td>
                <td>:</td>
                <td><select name="lap_type" id="lap_type" onChange="GetOrgnSubst(this.value);">
				<option value="0">Select Laptop Type</option>
				<option value="O">Original</option>
				<option value="S">Substitute</option>
				</select>
				</td>
              </tr>
			   
			   <tr>
                <td><b>Division</b></td>
                <td>:</td>
                <td><?php echo GetDivisionName($row['division']);?></td>
              </tr>
              <tr>
                <td><b>Region</b></td>
                <td>:</td>
                <td><input type="text" name="region" id="region" value="<?php echo $row[5];?>"size="20"></td>
              </tr>
              <tr>
                <td><b>Laptop Model</b></td>
                <td>:</td>
                <td><select name="laptop_model1" id="MtLap" style="display:none;" ></select><div id="NonMtLap"><?php echo GetSubstiLaptop();?></div>
				</td>
              </tr>			   
              <tr>
                <td><b>Dispatch To Depot</b></td>
                <td>:</td>
                <td><?php echo GetDispatchLocation();?></td>
              </tr>
			  <tr>
                <td><b>Dispatch Location Address</b></td>
                <td>:</td>
                <td><input type="text" name="dispatch_location_address" id="dispatch_location_address" size="20"></td>
              </tr>
              <tr>
                <td><b>Dispatch Date</b></td>
                <td>:</td>
                <td><input  type="text" id="doc3" name="doc3" value="" readonly="readonly" size="15"/>
                  &nbsp;<img src="images/icon_calendar.png" id="icon_calendar1" width="20" height="17" alt="Calendar" border="0" align="absmiddle" onMouseOver="CalCalender('doc3','icon_calendar1')" /> &nbsp;<small>(dd-mm-yyyy)</small>&nbsp;&nbsp;<span style="color:#FF0000">(Mention the date at which laptops are to be delivered)</span></td>
              </tr>
			  
			  
			   			  <input type="hidden" value="2" id="indnew" name="indnew" />

                 <?php }
			  elseif($_REQUEST['action']=='grp_new'){
			   ?>
			  <tr>
                <td width="144px"><b>Depot Location</b></td>
                <!--php code here -->
                <td>:</td>
                <td><?php echo GetDepotLocation();?>
                </td>
              </tr>
			  <tr>
                <td><b>Employee No</b></td>
                <td>:</td>
                <td><input type="text" name="empno0" id="empno0" size="20"></td>
              </tr>
              <tr>
                <td><b>Employee Firstname</b></td>
                <td>:</td>
                <td><input name="emp_fname0" id="emp_fname0" type="text" size="20"></td>
              </tr>
              <tr>
                <td><b>Employee Lastname</b></td>
                <!--php code here -->
                <td>:</td>
                <td><input name="emp_lname0" id="emp_lname0" type="text" size="20">
                </td>
              </tr>
			  
			  
			  <tr>
                <td><b>Employee Designation</b></td>
                <!--php code here -->
                <td>:</td>
                <td><?php echo GetEmpDesignationNameGroup();?>
                </td>
              </tr>

			   <tr>
                <td><b>Date Of Joinning</b></td>
                <!--php code here -->
                <td>:</td>
                <td><input  type="text" id="docgdate0" name="docgdate0" value="" readonly="readonly" size="15"/>
                  &nbsp;<img src="images/icon_calendar.png" id="icon_calendargdate" width="20" height="17" alt="Calendar" border="0" align="absmiddle" onMouseOver="CalCalender('docgdate0','icon_calendargdate')" /> &nbsp;<small>(dd-mm-yyyy)</small>&nbsp;&nbsp;<span style="color:#FF0000"></span>
                </td>
              </tr>
			  
		     <tr>
                <td><b>Employee Address</b></td>
                <td>:</td>
                <td><input type="text" name="emp_address0" id="emp_address0" size="20"></td>
              </tr>
              <tr>
                <td><b>Employee Telephone</b></td>
                <td>:</td>
                <td><input type="text" name="emp_telno0" id="emp_telno0" size="20" onKeyPress="return phoneValue(event)"></td>
              </tr>
			  <tr>
                <td><b>Employee Email Address</b></td>
                <td>:</td>
                <td><input name="emp_email0" id="emp_email0" type="text" size="20"></td>
              </tr>
			  <tr>
                <td><b>Reporting to Depot</b></td>
                <!--php code here -->
                <td>:</td>
                <td><?php echo GetEmpDepotGroup();?>
                </td>
              </tr>           
			  
			   
			   			   <tr>
                <td><b>Division</b></td>
                <td>:</td>
                <td><?php echo GetDivisionNameGroup();?></td>
              </tr>
              <tr>
                <td><b>Region</b></td>
                <td>:</td>
                <td><input type="text" name="region0" id="region0" size="20"></td>
              </tr>
              <tr>
                <td><b>Laptop Model</b></td>
                <td>:</td>
                <td><select name="laptop_model10" id="MtLap" style="display:none;" ></select>
				<div id="NonMtLap"><?php echo GetLaptopModelNameGroup();?></div></td>
              </tr>

			    <tr>
			   <td colspan="3">&nbsp;</td>
			   </tr>
			   <tr>
			   <td colspan="3"><div id="myDiv"> </div></td>
			   </tr>
			   <tr>
			   <td colspan="3">&nbsp;</td>
			   </tr>
			   
			   
			   
			   <input type="hidden" value="0" name="grpemp" id="grpemp" />

			   
			   <input type="hidden" value="0" id="theValue" />
<p><a href="javascript:;" onclick="addElement();">Add More Employees</a></p>

			   
			   			 
              <tr>
                <td><b>Dispatch To Depot</b></td>
                <td>:</td>
                <td><?php echo GetDispatchLocation();?></td>
              </tr>
			  <tr>
                <td><b>Dispatch Location Address</b></td>
                <td>:</td>
                <td><input type="text" name="dispatch_location_address" id="dispatch_location_address" size="20"></td>
              </tr>
              <tr>
                <td><b>Dispatch Date</b></td>
                <td>:</td>
                <td><input  type="text" id="doc3" name="doc3" value="" readonly="readonly" size="15"/>
                  &nbsp;<img src="images/icon_calendar.png" id="icon_calendar1" width="20" height="17" alt="Calendar" border="0" align="absmiddle" onMouseOver="CalCalender('doc3','icon_calendar1')" /> &nbsp;<small>(dd-mm-yyyy)</small>&nbsp;&nbsp;<span style="color:#FF0000">(Mention the date at which laptops are to be delivered)</span></td>
              </tr>
			  
			  
			  <input type="hidden" value="3" id="indnew" name="indnew" />
			  
			   
               <?php }
			  elseif($_REQUEST['action']=='grp_old'){
			   ?>
			  
			  <tr>
                <td><b>Depot Location</b></td>
                <!--php code here -->
                <td>:</td>
                <td><?php echo GetDepotLocation();?>
                </td>
              </tr> 
			   
			  <tr>
                <td><b>Employee No</b></td>
                <td>:</td>
                <td><input name="emp_oldno0" id="emp_oldno0" type="text" size="20"></td>
              </tr>
			 
			   			

			   
			  <tr>
                <td><b>Division</b></td>
                <td>:</td>
                <td><?php echo GetDivisionNameGroup();?></td>
              </tr>
              <tr>
                <td><b>Region</b></td>
                <td>:</td>
                <td><input type="text" name="region0" id="region0" size="20"></td>
              </tr>
              <tr>
                <td><b>Laptop Model</b></td>
                <td>:</td>
                <td><select name="laptop_model10" id="MtLap" style="display:none;" ></select>
				<div id="NonMtLap"><?php echo GetLaptopModelNameGroup();?></div></td>
              </tr>
			   <tr>
			   <td colspan="3"><div id="myDiv1"> </div></td>
			   </tr>
			
			   <input type="hidden" value="0" name="grpemp" id="grpemp" />

              <tr>
                <td><b>Dispatch To Depot</b></td>
                <td>:</td>
                <td><?php echo GetDispatchLocation();?></td>
              </tr>
			  <tr>
                <td><b>Dispatch Location Address</b></td>
                <td>:</td>
                <td><input type="text" name="dispatch_location_address" id="dispatch_location_address" size="20"></td>
              </tr>
			  
			  
              <tr>
                <td><b>Dispatch Date</b></td>
                <td>:</td>
                <td><input  type="text" id="doc3" name="doc3" value="" readonly="readonly" size="15"/>
                  &nbsp;<img src="images/icon_calendar.png" id="icon_calendar1" width="20" height="17" alt="Calendar" border="0" align="absmiddle" onMouseOver="CalCalender('doc3','icon_calendar1')" /> &nbsp;<small>(dd-mm-yyyy)</small>&nbsp;&nbsp;<span style="color:#FF0000">(Mention the date at which laptops are to be delivered)</span></td>
              </tr>
			  
			  
			   	<input type="hidden" value="4" id="indnew" name="indnew" />
			   
			     <input type="hidden" value="0" id="theValue1" />
<p><a href="javascript:;" onclick="addOldElement();">Add More Employees</a></p>



			  <?php }
			  else{/*
			   ?>
			   <tr>
                <td><b>Division</b></td>
                <td>:</td>
                <td><?php echo GetDivisionName();?></td>
              </tr>
              <tr>
                <td><b>Region</b></td>
                <td>:</td>
                <td><input type="text" name="region" id="region" size="20"></td>
              </tr>
              <tr>
                <td><b>Laptop Model</b></td>
                <td>:</td>
                <td><?php echo GetLaptopModelName();?></td>
              </tr>
              <tr>
                <td><b>Depot</b></td>
                <!--php code here -->
                <td>:</td>
                <td><?php echo GetDepot();?>
                </td>
              </tr>
              <tr>
                <td><b>Dispatch Location</b></td>
                <td>:</td>
                <td><input type="text" name="dispatch_location" id="dispatch_location" size="20"></td>
              </tr>
              <tr>
                <td><b>Dispatch Date</b></td>
                <td>:</td>
                <td><input  type="text" id="doc3" name="doc3" value="" readonly="readonly" size="15"/>
                  &nbsp;<img src="images/icon_calendar.png" id="icon_calendar1" width="20" height="17" alt="Calendar" border="0" align="absmiddle" onMouseOver="CalCalender('doc3','icon_calendar1')" /> &nbsp;<small>(dd-mm-yyyy)</small>&nbsp;&nbsp;</td>
              </tr>*/?>
			  <input type="hidden" value="0" id="indnew" name="indnew" />
			<?php } ?>
			  
			   
              
              <!--add javascript date here-->
              <tr>
                <td colspan="3" align="center" id="submitbutt">
				<input type="hidden" name="PageName" value="<?php echo $_SERVER['REQUEST_URI'];?>" />
				<input type="submit" value="Submit" name="submit" onClick="return Validate_Request_Type('frmRequestLaptop');"></td>
              </tr>
            </table>
			</form>
			</td>
        </tr>
      </table></td>
  </tr>
</table>
<script type="text/javascript">
function addElement() {
  var ni = document.getElementById('myDiv');
  var numi = document.getElementById('theValue');
  var num = (document.getElementById('theValue').value -1)+ 2;
  numi.value = num;
  var newdiv = document.createElement('div');
  var divIdName = 'my'+num+'Div';
  newdiv.setAttribute('id',divIdName);
  newdiv.innerHTML = '<table border="0" class="grid1"><tr><td colspan="3"><b style="font-size:12px;color:red"><u>Add Employee Details</u></b></td></tr><tr><td><b>Employee No</b></td><td>:</td><td><input type="text" name="empno'+num+'" id="empno'+num+'" size="20"></td></tr><tr><td><b>Employee Firstname</b></td><td>:</td><td><input name="emp_fname'+num+'" id="emp_fname'+num+'" type="text" size="20"></td></tr><tr><td><b>Employee Lastname</b></td><td>:</td><td><input name="emp_lname'+num+'" id="emp_lname'+num+'" type="text" size="20"></td></tr><tr><td><b>Employee Designation</b></td><td>:</td><td><select name="emp_desn'+num+'" id="emp_desn'+num+'" ><?php echo GetEmpDesignationNameMore();?></select></td></tr><tr><td><b>Date Of Joinning</b></td><td>:</td><td><input  type="text" id="docgdate'+num+'" name="docgdate'+num+'"  value="" readonly="readonly" size="15"/>&nbsp<img src="images/icon_calendar.png" id="icon_calendargdate'+num+'" width="20" height="17" alt="Calendar" border="0" align="absmiddle" onMouseOver=CalCalender("docgdate'+num+'","icon_calendargdate'+num+'");></td></tr><tr><td><b>Employee Address</b></td><td>:</td><td><input type="text" name="emp_address'+num+'" id="emp_address'+num+'" size="20"></td></tr><tr><td><b>Employee Telephone</b></td><td>:</td><td><input type="text" name="emp_telno'+num+'" id="emp_telno'+num+'" size="20" onKeyPress="return phoneValue(event)"></td></tr><tr><td><b>Employee Email Address</b></td><td>:</td><td><input name="emp_email'+num+'" id="emp_email'+num+'" type="text" size="20"></td></tr><tr><td><b>Reporting to Depot</b></td><td>:</td><td><select name="depot'+num+'" id="depot'+num+'"><?php echo GetEmpDepotMore();?></select></td></tr><tr><td><b>Division</b></td><td>:</td><td><select name="division'+num+'" id="division'+num+'"><?php echo GetDivisionNameGroupMore();?></select></td></tr><tr><td><b>Region</b></td><td>:</td><td><input type="text" name="region'+num+'" id="region'+num+'" size="20"></td></tr><tr><td><b>Laptop Model</b></td><td>:</td><td><select name="laptop_model1'+num+'" id="MtLap" style="display:none;" ></select><div id="NonMtLap"><select name="laptop_model'+num+'" id="laptop_model'+num+'"><?php echo GetLaptopModelNameGroupMore();?></select></div><input type="hidden" value="'+num+'" name="addgrpemp" id="addgrpemp" /><input type="hidden" value="'+num+'" name="grpemp" id="grpemp" /></td></tr></table><br><br>';
  ni.appendChild(newdiv);
}

function removeElement(divNum) {
var d = document.getElementById('myDiv');
d.removeChild(divNum);
}
</script>

<script type="text/javascript">
function addOldElement() {
  var ni = document.getElementById('myDiv1');
  var numi = document.getElementById('theValue1');
  var num = (document.getElementById('theValue1').value -1)+ 2;
  numi.value = num;
  var newdiv = document.createElement('div');
  var divIdName = 'my'+num+'Div';
  newdiv.setAttribute('id',divIdName);
 newdiv.innerHTML = '<table border="0" class="grid1"><tr><td><b>Employee No</b></td><td>:</td><td><input name="emp_oldno'+num+'" id="emp_oldno'+num+'" type="text" size="20"></td></tr><tr><td><b>Division</b></td><td>:</td><td><select name="division'+num+'" id="division'+num+'"><?php echo GetDivisionNameGroupMore();?></select></td></tr><tr><td><b>Region</b></td><td>:</td><td><input name="region'+num+'" id="region'+num+'" type="text" size="20"></td></tr><tr><td><b>Laptop Model</b></td><td>:</td><td><select name="laptop_model1'+num+'" id="MtLap" style="display:none;"></select><div id="NonMtLap"><select name="laptop_model'+num+'" id="laptop_model'+num+'"><?php echo GetLaptopModelNameGroupMore();?></select></div><input type="hidden" value="'+num+'" name="addgrpemp" id="addgrpemp" /><input type="hidden" value="'+num+'" name="grpemp" id="grpemp" /></td></tr></	><br>';
  ni.appendChild(newdiv);
}

function removeElement(divNum) {
var d = document.getElementById('myDiv1');
d.removeChild(divNum);
}

function getData(value)
{
document.location.href = 'request_laptop_main.php?action=ind_old&emp_no='+value;
document.getElementById('emp_oldno').value=trim(value);
//document.getElementById('emp_oldno').value = trim(value);
}
</script>